package com.hopu.controller;

import com.hopu.pojo.Dept;
import com.hopu.service.IDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/dept")
@Scope("prototype")
public class DeptController {

    @Autowired
    private IDeptService deptService;

    @RequestMapping(value = "/findAll")
    public List<Dept> findAll() throws Exception {
        List<Dept> all = deptService.findAll();
        System.out.println(all);
        return all;
    }

}
